<?php
require("conexao.php");
if (isset($_GET["acao"])){
$acao = $_GET["acao"];
}else{
$acao = "";
}
if (isset($_GET["id"])){
$id = $_GET["id"];
}else{
$id = "";
}

if ($acao != "") {
$sql = "select * from administracao where id_adm= $id";
$resultado = mysql_query ($sql);
$linha = mysql_fetch_array($resultado);

$nome = $linha["nome"];
$email = $linha["email"];
$login = $linha["login"];
$senha = $linha["senha"];
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
	font-size: 18px;
	font-weight: bold;
}
-->
</style>
</head>

<body>

<table width="99%" border="0">
  <tr>
    <td><div align="center" class="style1">Administrador</div></td>
  </tr>
  <tr>
    <td><form id="form1" name="form1" method="post" action="op_usuario.php">
      <table width="300" border="1" align="center">
        <tr>
          <td width="74">Nome: </td>
          <td width="216"><label>
            <input name="txt_nome" type="text" id="txt_nome" size="35" value= "<?php echo $nome ?>" />
          </label></td>
        </tr>
        <tr>
          <td width="74">Email:</td>
          <td><input name="txt_email" type="text" id="txt_email" size="35" value= "<?php echo $email ?>" /></td>
        </tr>
        <tr>
          <td width="74">Login:</td>
          <td><input name="txt_login" type="text" id="txt_login" size="35" value= "<?php echo $login ?>" /></td>
        </tr>
        <tr>
          <td width="74">Senha:</td>
          <td><input name="txt_senha" type="password" id="txt_senha" size="35" value= "<?php echo $senha ?>" /></td>
        </tr>
        <tr>
          <td colspan="2"><label>
              <div align="center">
                <input name="id" type="hidden" value="<?php echo $id; ?>" />
                <input name="acao" type="hidden" value="<?php
				 if ($acao != "") 
				 {echo $acao;
				 } else {
				  echo "Inserir";
				  } ?>" />
                <input type="submit" name="Submit" value="<?php
				 if ($acao != "") 
				 {echo $acao;
				 } else {
				  echo "Inserir";
				  } ?>" />
                  <input type="button" value="Voltar" onclick=javascript:window.history.back()>
              </div>
            </label></td>
        </tr>
      </table>
    </form></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

</body>
</html>
